<?php

/**
 * PHP Captcha Form Validator
 *
 * @package    sfPHPCaptchaPlugin
 * @subpackage form
 * @author     Sven Wappler <info@wapplersystems.de>
 */
class sfvalidatorFormTreeComplex extends sfValidatorBase  {


    protected function doClean($value) {

        //var_dump( $value );exit;
        /*
        if( !empty($value['is_root']) ){
        return null;
        }*/
        if($this->getOption('required')){
            if(empty($value['models']) || !is_array($value['models']) || count($value['models']) == 0 ){
                throw new sfValidatorError($this, 'required');
            }

        }
        return $value;


    }

}

